package com.study.enummap;

import java.util.EnumMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

import com.study.enummap.Herb.Type;

public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
//		getGarden();
		
		getPhase();
	}

	private static void getPhase() {
		System.out.println("" + Phase.Transition.from(Phase.GAS, Phase.LIQUID));
	}

	private static void getGarden() {
		Herb[] garden = initGarden();
		
		Map<Herb.Type, Set<Herb>> herbsByType = new EnumMap<Herb.Type, Set<Herb>>(Herb.Type.class);
		for(Herb.Type t : Herb.Type.values()){
			herbsByType.put(t, new HashSet<Herb>());
		}
		for(Herb h : garden){
			herbsByType.get(h.type).add(h);
		}
		System.out.println(herbsByType);
	}

	private static Herb[] initGarden() {
		Herb[] garden = new Herb[7];
		
		Herb herb1 = new Herb("herb1", Type.ANNUAL);
		Herb herb2 = new Herb("herb2", Type.BIENNIAL);
		Herb herb3 = new Herb("herb3", Type.PERENNIAL);
		Herb herb4 = new Herb("herb4", Type.PERENNIAL);
		Herb herb5 = new Herb("herb5", Type.BIENNIAL);
		Herb herb6 = new Herb("herb6", Type.BIENNIAL);
		Herb herb7 = new Herb("herb7", Type.ANNUAL);
		
		garden[0] = herb1;
		garden[1] = herb2;
		garden[2] = herb3;
		garden[3] = herb4;
		garden[4] = herb5;
		garden[5] = herb6;
		garden[6] = herb7;
		return garden;
	}

}
